using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using BlogEngine.Core;

public partial class admin_gallery_breadcrumb : System.Web.UI.UserControl
{
	protected Album album;
	protected Photo photo;

	protected void Page_Load(object sender, EventArgs e)
	{
		if (Request.QueryString["AlbumId"] != null)
			album = Album.GetById(new Guid(Request.QueryString["AlbumId"]));
		if (Request.QueryString["PhotoId"] != null)
			photo = Photo.GetById(new Guid(Request.QueryString["PhotoId"]));

		if (photo != null)
			album = photo.Album;

		lbOne.Visible = false;
		lbTwo.Visible = false;
		hlAlbum.Visible = false;
		hlPhoto.Visible = false;

		if (album != null)
		{
			hlAlbum.Text = album.Title;
			hlAlbum.NavigateUrl = "EditAlbum.aspx?AlbumID=" + album.Id.ToString();
			hlAlbum.Visible = true;
			lbOne.Visible = true;
		}

		if (photo != null)
		{
			hlPhoto.Text = (!string.IsNullOrEmpty(photo.Title)) ? photo.Title : "[Untitled]";
			hlPhoto.NavigateUrl = "EditPhoto.aspx?PhotoID=" + photo.Id.ToString();
			hlPhoto.Visible = true;
			lbTwo.Visible = true;
		}

	}
}
